package com.ygqh.baby.mapper;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.AgentUserModel;
import com.ygqh.baby.model.YgUserRecommendModel;
import com.ygqh.baby.po.YgAgentInviteRecord;
import com.ygqh.baby.po.YgAgentInviteRecordExample;
import com.ygqh.baby.po.YgUser;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Ss
 */
public interface YgAgentInviteRecordMapper {

	int countByExample(YgAgentInviteRecordExample example);

	int deleteByExample(YgAgentInviteRecordExample example);

	int deleteByPrimaryKey(Long id);

	int insert(YgAgentInviteRecord record);

	int insertSelective(YgAgentInviteRecord record);

	List<YgAgentInviteRecord> selectByExample(YgAgentInviteRecordExample example);

	YgAgentInviteRecord selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") YgAgentInviteRecord record,
								 @Param("example") YgAgentInviteRecordExample example);

	int updateByExample(@Param("record") YgAgentInviteRecord record,
						@Param("example") YgAgentInviteRecordExample example);

	int updateByPrimaryKeySelective(YgAgentInviteRecord record);

	int updateByPrimaryKey(YgAgentInviteRecord record);

	int countSuper(@Param("nickName") String nickName, @Param("userName") String userName,
				   @Param("startDate") Date startDate, @Param("endDate") Date endDate,
				   @Param("orderStartDate") Date orderStartDate, @Param("orderEndDate") Date orderEndDate,
				   @Param("levelId") Long levelId);

	List<AgentUserModel> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("nickName") String nickName,
									 @Param("userName") String userName, @Param("startDate") Date startDate,
									 @Param("endDate") Date endDate, @Param("orderStartDate") Date orderStartDate,
									 @Param("orderEndDate") Date orderEndDate, @Param("levelId") Long levelId);

	int insertBatch(List<YgAgentInviteRecord> list);

	int updateBatch(List<YgAgentInviteRecord> list);

	List<YgAgentInviteRecord> selectByUserIdListAndBetweenTime(@Param("userIdList") List<Long> userIdList,
															   @Param("startDate") Date startDate,
															   @Param("endDate") Date endDate);

	List<AgentUserModel> selectReceiveListByUserId(@Param("userId") Long userId);

	int updateCreateTimeByIdList(@Param("list") List<Long> idList, @Param("createTime") Date createTime);

	Map<String,Object> selectRecommendUserCount(@Param("userId") Long userId, @Param("platformNo") String platformNo);

	List<YgUserRecommendModel> selectRecommendUser(@Param("queryInfo") QueryInfo queryInfo,
												   @Param("userId") Long userId,
												   @Param("platformNo") String platformNo);

	int countRecommendUser(@Param("userId") Long userId);

	List<YgUser> selectRecommendUserList(@Param("queryInfo") QueryInfo queryInfo, @Param("userId") Long userId);

    Map<String, Object> selectRecommendForRechargeUserAgent(@Param("userId") Long userId,
															@Param("platformNo") String platformNo);

    List<YgUserRecommendModel> selectRecommendUserBeforeRechargeUserAgent(@Param("queryInfo") QueryInfo queryInfo,
																		  @Param("userId") Long userId,
																		  @Param("platformNo") String platformNo);
}
